import Vue from "vue";
import VueRouter from "vue-router";

const originalPush = VueRouter.prototype.push;

VueRouter.prototype.push = function push(location) {
  return originalPush.call(this, location).catch((err) => err);
};
Vue.use(VueRouter);
const routes = [
  {
    path: "/login",
    name: "login",
    component: () => import("@/views/modules/login/login.vue"),
  },
  {
    path: "/404",
    name: "404",
    component: () => import("@/views/error/404"),
  },
  {
    path: "/401",
    name: "401",
    component: () => import("@/views/error/401"),
  },
];
const router = new VueRouter({
  mode: "history",
  base: process.env.BASE_URL,
  routes,
});
export default router;
